<?php
declare (strict_types = 1);

namespace app\course\service\live;

use think\Request;
use app\common\service\BaseService;
use app\common\exception\LogicException;
use app\course\logic\live\LiveRoom as LiveRoomLogic;
/**
 * 直播课程接口类-前台
 */
class LiveRoom extends BaseService
{
    
   /**
    * 房间创建成功添加记录
    * Author 亓官雨树<lucky.max@foxmail.com>
    * Date：   2020-06-19
    * @param  Request                     $request [description]
    * @return [type]                               [description]
    */
    public function createRoom(Request $request)
    {
        $param = $request->post();
        $re    = app(LiveRoomLogic::class)->createRoom($param);

        return $this->parseToData($re, 1, '创建成功');
    }

    /**
    * 直播结束关闭房间添加记录
    * Author 亓官雨树<lucky.max@foxmail.com>
    * Date：   2020-06-19
    * @param  Request                     $request [description]
    * @return [type]                               [description]
    */
    public function endRoom(Request $request)
    {
        $param = $request->post();
        $re    = app(LiveRoomLogic::class)->endRoom($param);

        return $this->parseToData($re, 1, '结束成功');
    }


}
